package com.hissy.common.generator_01;

import java.io.Serializable;
import java.util.Collection;

/**
 * Created by zhangyanfei on 2018/5/29.
 * 对象数组返回值
 *
 * @author zhangyanfei
 * @date 2018/05/29
 */
@Description("对象数组返回值")
public class ObjectArrayResp implements Serializable {
    @Description("对象数组返回值")
    public Object[] value;

    public static ObjectArrayResp convert(Object[] array) {
        ObjectArrayResp arrayResp = new ObjectArrayResp();
        arrayResp.value = array;
        return arrayResp;
    }

    public static ObjectArrayResp convert(Collection collection) {
        ObjectArrayResp arrayResp = new ObjectArrayResp();
        if (collection != null && collection.size() > 0) {
            arrayResp.value = collection.toArray();
        }
        return arrayResp;
    }
}
